package com.example;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

// 使用 @Configuration 注解表明这是一个配置类
@Configuration
// 使用 @ComponentScan 注解指定 Spring 要扫描的包路径，确保能找到 User 类
@ComponentScan(basePackages = "com.example") // 根据实际包名修改
public class AppConfig {
    @Bean(initMethod = "customInit", destroyMethod = "customDestroy")
    public MyBean myBean() {
        return new MyBean();
    }
}
